package com.gonsin.gview.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gonsin.gview.annotations.interfaces.IBatchActionListener;
import com.gonsin.gview.annotations.interfaces.IConfirmActionListener;
import com.gonsin.gview.annotations.interfaces.IDownloadActionListener;
import com.gonsin.gview.annotations.interfaces.IFileActionListener;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.lang.reflect.Method;

@Data
@ApiModel("按钮点击事件实现")
public class GActionModel {

    /**
     * 文件上传事件
     */
    private transient IFileActionListener fileActionListener;

    /**
     * 批量操作事件
     */
    private transient IBatchActionListener batchActionListener;

    /**
     * 消息确认事件
     */
    private transient IConfirmActionListener confirmActionListener;

    /**
     * 消息确认事件
     */
    private transient IDownloadActionListener downloadActionListener;

    /**
     * 方法对应的类和方法
     */
    private Object actionService;
    private Method actionMethod;

    /**
     * 通过上传事件创建
     */
    public GActionModel(IFileActionListener fileActionListener) {
        this.fileActionListener = fileActionListener;
    }

    /**
     * 通过上传事件创建
     */
    public GActionModel(IDownloadActionListener downloadActionListener) {
        this.downloadActionListener = downloadActionListener;
    }


    /**
     * 通过批量操作事件创建
     */
    public GActionModel(IBatchActionListener batchActionListener) {
        this.batchActionListener = batchActionListener;
    }


    /**
     * 通过确认实践上传
     */
    public GActionModel(IConfirmActionListener confirmActionListener) {
        this.confirmActionListener = confirmActionListener;
    }
}
